<?php if(!empty($output['auction'])):?>
    <?php foreach($output['auction'] as $auction):?>
        <section class="floor">
            <div class="files">
                <div class="touxiang">
                    <a href="index.php?act=my&op=home&uid=<?php echo $auction['user_id'];?>">
                        <img src="<?php echo $auction['avatar'];?>" >
                    </a>
                </div>
                <div class="names">
                    <?php echo $auction['nickname'];?>
                </div>
                <div>
                    <div class="dongji1">V<?php echo strtolower($auction['level'])?></div>
                    <div class="dongji2">白丁</div><!-- 暂时没有发现白丁数据-->
                </div>
            </div>
            <div class="info">
                <h3>
                    <?php
                    $xy_des=$auction['auction_description'];
                    $xy_des=nl2br($xy_des);
                    echo $xy_des;
                    ?>
                </h3>
                <div class="money">

                    <?php if(!empty($auction['log'])):?>
                        <div><img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/money.svg" /></div><div>目前价格:<?php echo $auction['log'][0]['auction_price'];?></div>
                    <?php endif;?>
                </div>
                <div class="content">
                    <div class="img-list" imgall="<?php echo $auction['id'];?>">
                        <?php if(!empty($auction['img'])):?>
                            <?php foreach($auction['img'] as $v):?>
                                <div class="img-box">
                                    <div>
                                        <img src="<?php echo bearshop_cut_image(UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$v['auction_img']);?>" />
                                    </div>
                                </div>
                            <?php endforeach;?>
                        <?php endif;?>
                    </div>
                </div>
                <div class="tags" style="overflow:hidden;padding: 10px 0;">
                    <?php $likeclass = 'likeIt';?>
                    <?php $likecount = count($auction['like']);?>
                    <?php if(!empty($auction['like'])){?>
                        <?php foreach($auction['like'] as $like){?>
                            <?php
                            if($like['user_id']==$_COOKIE['user_id']){
                                $likeclass='liked';
                                break;
                            }
                            ?>
                        <?php }?>
                    <?php }?>
                    <?php
                    if($auction['is_company']==1){
                        if($likecount>=$output['renzheng_likenum']){
                            $likeclass='liked';
                        }
                    }else{
                        if($likecount>=$output['common_likenum']){
                            $likeclass='liked';
                        }
                    }
                    ?>
                    <div style="float:left;">
                        <img style="width:40px;height:40px;vertical-align:middle;" src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/huo.svg" /><span><?php echo $auction['viewnum'];?></span>&nbsp;&nbsp;|
                    </div>
                    <div style="float:left;" class="liked" like_auction_id="<?php echo $auction['id'];?>">&nbsp;&nbsp;
                        <img class="<?php if(empty($likeclass)){ echo 'likeIt';}else{ echo $likeclass;}?>" like_auction_id=<?php echo $auction['id'];?> style="width:40px;height:40px;vertical-align:middle;" src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/xin.svg" /><span><?php echo $auction['likenum'];?></span>&nbsp;&nbsp;|
                    </div>
                    <?php if(($_COOKIE['user_id']==$auction['seller_id'])){?>
                        <?php if(($auction['auction_log_id']>0)||($auction['yikoujia_end']==1)){?>
                            <?php if(($auction['end_time']<time())||($auction['yikoujia_end']==1)){?>
                                <?php if($auction['is_show']==1){?>
                                    <!-- <a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>-->
                                <?php }else{?>
                                    <!--<a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>-->
                                <?php }?>
                            <?php }?>
                        <?php }else{?>
                            <?php if(($auction['end_time']<time())){?>
                                <?php if($auction['is_show']==1){?>
                                    <!--<a class="saleToggle auctionshow" href="javascript:;"><span class="showauction" auction_id="<?php echo $auction['id'];?>">显示</span></a>-->
                                <?php }else{?>
                                    <!--<a class="saleToggle auctionhide" href="javascript:;"><span class="hideauction" auction_id="<?php echo $auction['id'];?>">隐藏</span></a>-->
                                <?php }?>
                            <?php }else{?>
                                <a class="saleToggle" href="javascript:;"><span class="xiajia" auction_id="<?php echo $auction['id'];?>">下架</span></a>
                            <?php }?>
                        <?php }?>
                    <?php }?>
                    <div class="fenxiang" style="float:left;" auction_id="<?php echo $auction['id'];?>"
                         auction_description="<?php echo $auction['auction_description'];?>"
                         nickname="<?php echo $auction['nickname'];?>"
                         imgurl="<?php echo UPLOAD_SITE_URL.'/shop/auction/'.$auction['auction_add_date'].'/'.$auction['auction_img1'];?>">&nbsp;&nbsp;
                        <img style="width:40px;height:40px;vertical-align:middle;" src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/fenxiang.svg" /><span>分享</span>
                    </div>
                </div>
                <div class="tests">“菩提”一词是梵文Bodhi的音译，意思是觉悟、智慧，用以指人忽如睡醒，豁然开悟，突入彻悟途径，顿悟真理，达到超凡脱俗的境界等。</div>
            </div>
            <div class='xiangxi'>
                <div class="jieshu js-time">
                    <?php if($auction['end_time']>time() && $auction['yikoujia_end']=='0'){//正在进行?>
                        <img style="width:40px;height:40px;vertical-align:middle;" src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/times2.svg" />距离结束 <span class="process" endtime="<?php echo $auction['end_time'];?>" aid="<?php echo $auction['id'];?>" con="<?php echo date('Y年m月d日',$auction['end_time']);?>"></span>
                        <?php if((time()>($auction['end_time']-300))&&$auction['yikoujia']=='0'){?>
                            <div class="timeline">
                                <p class="timelinedo">5分钟进入延时竞价周期</p>
                            </div>
                        <?php }?>
                    <?php }else{?>
                        <!--  拍卖结束 -->
                        <div class="bidBtns" bidaid="<?php echo $auction['id'];?>">
                            <div class="saleEndBtn"><?php echo date('Y年m月d日',$auction['end_time']);?>&nbsp;拍卖结束 </div>
                        </div>
                    <?php }?>
                </div>
                <div class="jiage">
                    <p class="buttin">
                        <a onclick="javascript:location.href ='index.php?act=index&auction_id=<?php echo $auction['id'];?>&user_id=<?php echo $_COOKIE['user_id'];?>'">
                            <img class="gengxin" src ="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/gengxin.png"/>
                        </a>
                        <a href="javascript:0;" class="bidBtngre" bidauction="<?php echo $auction['id'];?>">
                            <img class="chujia" src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/chujia.png"/>
                        </a>
                    </p>
                    <p class="tabs">
                        <img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/qi.png" alt="">￥<?php echo $auction['firstprice'];?>
                        <img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/jia.png" alt="">￥<?php echo $auction['addprice'];?>
                        <img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/bao.png" alt="">￥<?php echo $auction['cashprice'];?>
                    </p>
                </div>
                <div class="xieyi"> <img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/xieyi.png"/></div>
                <ul class="bid-list">
                    <?php if(!empty($auction['log'])):?>
                        <?php foreach($auction['log'] as $k=>$log):?>
                            <li>
                                <div class="touxiang">
                                    <a href="index.php?act=my&op=home&uid=<?php echo $log['user_id'];?>">
                                        <img src="<?php echo $log['avatar'];?>"/>
                                    </a>
                                </div>
                                <div class="names">
                        <span>
                            <?php echo $log['nickname'];?>
                        </span></br>
                                    出价：<b>￥<?php echo $log['auction_price'];?></b>
                                </div>
                                <div class="times" cur="<?php echo $auction['id'];?>">
                                    <div class="js-time" aid="<?php echo $auction['id'];?>" endtime="<?php echo $auction['end_time'];?>"></div>
                                    <img src="<?php echo TEMPLATE_SITE_URL;?>/zsm-static/pic/jiangpai<?php echo (($k+1)>=2)?2:1;?>.svg"/>
                                </div>
                            </li>
                            <?php
                            $k++;
                            if($k>=3){
                                break 2;
                            }
                            ?>
                        <?php endforeach;?>
                    <?php endif;?>
                </ul>
            </div>
        </section>
    <?php endforeach;?>
<?php endif;?>

<script type="text/javascript">
    $(function(){
        var selector = '.showimg'+'<?php echo $_GET['pagenum']?>';
        $(selector).click(function(){
            var current = $(this).attr('url');
            var aid = $(this).attr('aid');
            var images = {};
            images.current = current;
            images.urls = [];
            $('div[imgall="'+aid+'"]').children('div').each(function(){
                images.urls.push($(this).attr('url'));
            });

            wx.previewImage(images);
        });

        var selector_desc = '.desc'+'<?php echo $_GET['pagenum']?>';
        $(selector_desc).each(function(){
            var h = $(this).height();
            var auction_id = $(this).data('auction_id');
            if(h>98){
                $(this).height(98);
                $(this).css("overflow","hidden");
                $(".quanwen"+auction_id).show();
            }else{
                $(this).css("overflow","visible");
                $(".quanwen"+auction_id).hide();
            }
        });

    });
</script>
